﻿using System;
using UnityEngine.Rendering;
using UnityEngine;
using LuaInterface;

public class SphericalHarmonicsL2Wrap
{
	public static LuaMethod[] regs = new LuaMethod[]
	{
		new LuaMethod("Clear", Clear),
		new LuaMethod("AddAmbientLight", AddAmbientLight),
		new LuaMethod("AddDirectionalLight", AddDirectionalLight),
		new LuaMethod("get_Item", get_Item),
		new LuaMethod("set_Item", set_Item),
		new LuaMethod("GetHashCode", GetHashCode),
		new LuaMethod("Equals", Equals),
		new LuaMethod("New", _CreateSphericalHarmonicsL2),
		new LuaMethod("GetClassType", GetClassType),
		new LuaMethod("__add", Lua_Add),
		new LuaMethod("__mul", Lua_Mul),
		new LuaMethod("__eq", Lua_Eq),
	};

	static LuaField[] fields = new LuaField[]
	{
	};

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int _CreateSphericalHarmonicsL2(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 0);
		SphericalHarmonicsL2 obj = new SphericalHarmonicsL2();
		LuaScriptMgr.PushValue(L, obj);
		return 1;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetClassType(IntPtr L)
	{
		LuaScriptMgr.Push(L, typeof(SphericalHarmonicsL2));
		return 1;
	}

	public static void Register(IntPtr L)
	{
		LuaScriptMgr.RegisterLib(L, "UnityEngine.Rendering.SphericalHarmonicsL2", typeof(SphericalHarmonicsL2), regs, fields, null);
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int Clear(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 1);
		SphericalHarmonicsL2 obj = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 1);
		obj.Clear();
		LuaScriptMgr.SetValueObject(L, 1, obj);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int AddAmbientLight(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SphericalHarmonicsL2 obj = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 1);
		Color arg0 = LuaScriptMgr.GetColor(L, 2);
		obj.AddAmbientLight(arg0);
		LuaScriptMgr.SetValueObject(L, 1, obj);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int AddDirectionalLight(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 4);
		SphericalHarmonicsL2 obj = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 1);
		Vector3 arg0 = LuaScriptMgr.GetVector3(L, 2);
		Color arg1 = LuaScriptMgr.GetColor(L, 3);
		float arg2 = (float)LuaScriptMgr.GetNumber(L, 4);
		obj.AddDirectionalLight(arg0,arg1,arg2);
		LuaScriptMgr.SetValueObject(L, 1, obj);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int get_Item(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 3);
		SphericalHarmonicsL2 obj = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 1);
		int arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
		int arg1 = (int)LuaScriptMgr.GetNumber(L, 3);
		float o = obj[arg0,arg1];
		LuaScriptMgr.Push(L, o);
		return 1;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int set_Item(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 4);
		SphericalHarmonicsL2 obj = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 1);
		int arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
		int arg1 = (int)LuaScriptMgr.GetNumber(L, 3);
		float arg2 = (float)LuaScriptMgr.GetNumber(L, 4);
		obj[arg0, arg1] = arg2;
		LuaScriptMgr.SetValueObject(L, 1, obj);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetHashCode(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 1);
		SphericalHarmonicsL2 obj = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 1);
		int o = obj.GetHashCode();
		LuaScriptMgr.Push(L, o);
		return 1;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int Equals(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SphericalHarmonicsL2 obj = (SphericalHarmonicsL2)LuaScriptMgr.GetVarObject(L, 1);
		object arg0 = LuaScriptMgr.GetVarObject(L, 2);
		bool o = obj.Equals(arg0);
		LuaScriptMgr.Push(L, o);
		return 1;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int Lua_Mul(IntPtr L)
	{
		int count = LuaDLL.lua_gettop(L);

		if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(float), typeof(SphericalHarmonicsL2)))
		{
			float arg0 = (float)LuaScriptMgr.GetNumber(L, 1);
			SphericalHarmonicsL2 arg1 = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 2);
			SphericalHarmonicsL2 o = arg0 * arg1;
			LuaScriptMgr.PushValue(L, o);
			return 1;
		}
		else if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(SphericalHarmonicsL2), typeof(float)))
		{
			SphericalHarmonicsL2 arg0 = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 1);
			float arg1 = (float)LuaScriptMgr.GetNumber(L, 2);
			SphericalHarmonicsL2 o = arg0 * arg1;
			LuaScriptMgr.PushValue(L, o);
			return 1;
		}
		else
		{
			LuaDLL.luaL_error(L, "invalid arguments to method: SphericalHarmonicsL2.op_Multiply");
		}

		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int Lua_Add(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SphericalHarmonicsL2 arg0 = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 1);
		SphericalHarmonicsL2 arg1 = LuaScriptMgr.GetNetObject<SphericalHarmonicsL2>(L, 2);
		SphericalHarmonicsL2 o = arg0 + arg1;
		LuaScriptMgr.PushValue(L, o);
		return 1;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int Lua_Eq(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SphericalHarmonicsL2 arg0 = (SphericalHarmonicsL2)LuaScriptMgr.GetVarObject(L, 1);
		SphericalHarmonicsL2 arg1 = (SphericalHarmonicsL2)LuaScriptMgr.GetVarObject(L, 2);
		bool o = arg0 == arg1;
		LuaScriptMgr.Push(L, o);
		return 1;
	}
}

